//Graphiure Web Development Framework : Javascript

function initialize () {
	//Shows The Time
	showtime();
}

function showtime () {
	var dateObject = new Date();
	var hour = document.getElementById("hour");
    var minute = document.getElementById("minute");
	minute.innerHTML = dateObject.getMinutes();
	hour.innerHTML = dateObject.getHours();
}

var ajaxRequest;
function loadAjaxDoc(url)
{
ajaxRequest=null;
if (window.XMLHttpRequest)
  {// code for all new browsers
  ajaxRequest=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {// code for IE5 and IE6
  ajaxRequest=new ActiveXObject("Microsoft.XMLHTTP");
  }
if (ajaxRequest!=null)
  {
  ajaxRequest.onreadystatechange=loadAjaxdiv;
  ajaxRequest.open("GET",url,true);
  ajaxRequest.send(null);
  }
else
  {
  alert("Error: Your browser does not support ajax, please upgrade your browser.");
  }
}

function ajaxAction()
{
if (ajaxRequest.readyState==4)
  {// 4 = "loaded"
  if (ajaxRequest.status==200)
    {
    //Put Code here
	//If input is XML the output is in ajaxRequest.ResponseXML
	//If input is in Plaintext the output is in ajaxRequest.ResponseText
    }
  else
    {
    alert("Error: Failed to retrieve data.");
    }
  }
}

function loadAjaxdiv()
{
if (ajaxRequest.readyState==4)
  {// 4 = "loaded"
  if (ajaxRequest.status==200)
    {
    document.getElementById('ajaxdiv').innerHTML=ajaxRequest.responseText;
    }
  else
    {
    alert("Error: Failed to retrieve data.");
    }
  }
}

function startAjaxdiv() {
	loadAjaxDoc("ajaxdiv.txt");
	loadAjaxdiv();
}


